Only first param is needed. Order of params 3 to 7 doesn't matter, since the XCMD is able to recognize them.
<WName> is a string giving the windoid name. Many windoids can be opened by using different names.
<List> is a comma/return delimited string that will be displayed. Line separator is return, column is comma.
<WStyle> is a string defining the window style. Allowed styles are : plain, zoom, roundRect, rect, shadow, windoid, windoidZoom, bigWindoid, bigWindoidZoom, Rinaldoid, RinaldoidZoom (Rinaldoid is the same as windoid, except that it displays the window title). All window styles are floating, except plain, zoom and roundRect. A windoid or Rinaldoid style window will have small scrollbars, while other styles will use standard size. Default is RinaldoidZoom if Rinaldoid WDEF resource is present, windoidZoom if not found.
<X,Y[,Z,T]> will be a point or a rect, and will define position and/or size of the windoid. Coordinated are card-relative. If omitted, windoid will appear with standard size at "0,10".
<NO|ONE|CON|DIS> defines the selection mode (no selection, one at a time, may but adjacent, many disjoint). Default is ONE.
<cell(s)> is a comma separated list of cell coordinates. Each cell coordinate is a string of two integers separated by space, giving line and column number of the cell ("<line>_<column>[...,<line>_<column>]"). It defines the selected cells(s) when the windoid appears.
Default is "1 1", but "0 0" can be used to have no selection at start.
<textFont[,textSize]> is the name of font and its size to use. Default is Geneva 10.
<textAlign> is the text alignment in the cells (left, center, right). Default is "left".
<frame> is a boolean telling if the cells must be framed or not. Default is true, but frame appears only if Tabloid LDEF is present in resource fork.
Using "!" and "?" as parameter will return an online help (resp. copyright and syntax).
USING
Tabloid is stand alone, no linked resource is needed. Meanwhile, this stack contains a LDEF, WDEF and CDEF resources that are recognized by the XCMD if present.
The LDEF allows to have framed cells like in a spreadsheet, vertical centering of text in cells and text alignmenet. The WDEF allows to have an enhanced windoid-type window displaying title, while the CDEF is useful to get nice-looking scroll arrows for small scroll bars. So, these resources are optional, and for aesthetic purpose only. If you copy them, their ID can be set to any value but don't change their name.
Hint:
If you use a rect ot shadow style window, placing it on a card can simulate a smart HyperCard spreadsheet field.
If no rectangle param is used, the size of the window will be set according to maximum number of lines and columns contained in the list. The cells have all the same size which is automatically calculated according to the longest contained string.
Clicking on cells(s) in the windoid sends a "TabloidSelect" message followed by the clicked word(s) and the Tabloid name. This message can be trapped using a handler :
on TabloidSelect What,Where
if Where is "MyList" and What is ...
end TabloidSelect
Note:
in order to avoid HyperCard's confusion, existing quotes in What param are automatically changed to single quote.
When a windoid is opened, the "openTabloid" message is sent, followed by the windoid name. This allows to define window properties before it is shown, since the message can be trapped using a handler :
on openTabloid Which
if Which is "MyWindow" then...
end openTabloid
When a windoid is close, the "closeTabloid" message is sent, followed by the windoid name. This message can be trapped using a handler :
on closeTabloid Which
if Which is "MyWindow" then...
end closeTabloid
Hint:
the card script contains a "on ControlKey" handler that allows selection of first matching cell when typing a key in conjunction with control key. Moreover, while holding the control key down, the arrow keys allow to move in the list, return or enter to simulate a double-clic.
It is possible to send any string to search for to the window using :
send "string" to window <WName>
If the string is found, it will be highlighted int the window. Look for "on controlKey" handler in the card script, type Control+Key to try it.
The lockText property define the behaviour of the window. Default value is TRUE, meaning that a click on a cell selects it. When cursor is over window, holding Option key (or having lockText set to FALSE) allows to change cell size by dragging or edit their content. The cursor's shape tells exactly what can be done.
One in editing mode, cell is framed and moving around is possible using Tab or Return key with or without Shift key (validation). To exit editing, type Enter (validation) or Escape key (cancelling), or click in any other cell.
Setting properties involving cell size also resizes the window to keep previously visible cell still visible.
PROPERTIES
Like any XWindow, Tabloid has properties that can be get and set thru HyperTalk.
“properties of window "name"” will return an item list of all allowed properties :
• loc : windoid's position according to card
• visible : windoid's visibility
• text : windoid's text
• rect : windoid's position and size according to card
Free for non-commercial use. Use in commercial software subjected to prior acknowledgement and licensing from the author, reachable at the following network addresses: